﻿<%@ Page Title="" Language="C#" MasterPageFile="~/FreeBooks.master" AutoEventWireup="true" CodeFile="CategoryWise.aspx.cs" Inherits="CategoryWise" %>
<%@ Register src="UserControls/EBookList.ascx" tagname="EBookList" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<div id="body">
<h4>Showing <asp:Literal ID="ltCount" runat="server"></asp:Literal></h4>
<hr />
    <uc1:EBookList ID="eblCategoryBooks" runat="server">
        <ItemTemplate>
            <div class="bitem">
                <h3><%#DataBinder.Eval(Container.DataItem,"Title") %></h3>
                <span><%#DataBinder.Eval(Container.DataItem,"SubTitle") %></span>
                <p><img src='DBImageHandler.ashx?imgID=<%#DataBinder.Eval(Container.DataItem,"ThumbnailId")%>' align="left" />
                <span class="fieldrow"><span class="field">Author(s)</span>&nbsp;<%#DataBinder.Eval(Container.DataItem,"Authors") %></span>
                <span class="fieldrow"><span class="field">Publisher(s)</span>&nbsp;<asp:Literal ID="ltPublisher" runat="server" Text='<%#Publisher.GetPublisherById(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "PublisherId"))).PublisherName%>'></asp:Literal></span>
                <span class="fieldrow"><span class="field">Published Year</span>&nbsp;<%#DataBinder.Eval(Container.DataItem, "PublishedYear")%></span>
                <%#DataBinder.Eval(Container.DataItem,"Summary")%></p>
                <div class="readmore"><a href='bookDetail.aspx?BookId=<%#DataBinder.Eval(Container.DataItem,"Id") %>'>Read More</a></div>
            </div>
        </ItemTemplate>
        <AlternateItemTemplate>
            <div class="bitem">
                <h3><%#DataBinder.Eval(Container.DataItem,"Title") %></h3>
                <span><%#DataBinder.Eval(Container.DataItem,"SubTitle") %></span>
                <p><img src='DBImageHandler.ashx?imgID=<%#DataBinder.Eval(Container.DataItem,"ThumbnailId")%>' align="left" />
                <span class="fieldrow"><span class="field">Author(s)</span>&nbsp;<%#DataBinder.Eval(Container.DataItem,"Authors") %></span>
                <span class="fieldrow"><span class="field">Publisher(s)</span>&nbsp;<asp:Literal ID="ltAltPublisher" runat="server" Text='<%#Publisher.GetPublisherById(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "PublisherId"))).PublisherName%>'></asp:Literal></span>
                <span class="fieldrow"><span class="field">Published Year</span>&nbsp;<%#DataBinder.Eval(Container.DataItem, "PublishedYear")%></span>
                <%#DataBinder.Eval(Container.DataItem,"Summary")%></p>
                <div class="readmore"><a href='bookDetail.aspx?BookId=<%#DataBinder.Eval(Container.DataItem,"Id") %>'>Read More</a></div>
            </div>
        </AlternateItemTemplate>
        <FooterTemplate>
        </FooterTemplate>
    </uc1:EBookList>
</div>
</asp:Content>

